﻿$(document).ready(function () {
    $("#frmContact").live("submit", function (e) {
        var contactValues = $(this).serialize();
        $.validator.unobtrusive.parse($(this));

        if ($(this).valid()) {
            var mainDialog = updateDialog("צור קשר", "100", "400");

            //Invoke AJAX method to post the Contact
            $.post(pathPrefix + "Home/Contact", contactValues, function (result) {
                mainDialog.html(result.Value);

                window.setTimeout(function () {
                    window.location = pathPrefix;
                }, 3000);
            }, "json");
        }

        e.preventDefault();
    });
});